<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/templates/template_admin.xhtml">
        <ui:define name="content">
            <h:form styleClass="jsfcrud_list_form">

                <h1><h:outputText value="List Applicant"/></h1>
                <h:outputLabel value="#{amb.message}"/>
                <p:dataTable id="dataTable" value="#{amb.applicantList()}" var="a" paginator="true" rows="5"  
                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                             rowsPerPageTemplate="3,5,10,15">
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="ApplicantID"/>
                        </f:facet>
                        <h:outputText value="#{a.applicantID}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="FullName"/>
                        </f:facet>
                        <h:outputText value="#{a.firstName} #{a.lastName}"/>
                    </p:column>                                
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Gender"/>
                        </f:facet>
                        <h:selectOneMenu id="gender"
                                         value="#{a.gender}"
                                         styleClass="text-input medium-input" disabled="true">
                            <f:selectItem itemLabel="Male" itemValue="#{true}"/>
                            <f:selectItem itemLabel="Female" itemValue="#{false}" />
                        </h:selectOneMenu>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Dob"/>
                        </f:facet>
                        <h:outputText value="#{a.dob}">
                            <f:convertDateTime pattern="MM/dd/yyyy" />
                        </h:outputText>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="PhoneNumber"/>
                        </f:facet>
                        <h:outputText value="#{a.phoneNumber}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Email"/>
                        </f:facet>
                        <h:outputText value="#{a.email}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Address"/>
                        </f:facet>
                        <h:outputText value="#{a.address}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Degree"/>
                        </f:facet>
                        <h:outputText value="#{a.degree}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="CreatedDate"/>
                        </f:facet>
                        <h:outputText value="#{a.createdDate}">
                            <f:convertDateTime pattern="MM/dd/yyyy" />
                        </h:outputText>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Status"/>
                        </f:facet>
                        <h:outputText value="#{a.status}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Action"/>
                        </f:facet>
                        <h:commandLink value="View" action="#{amb.appView(a)}"/><br/>
                        <h:commandLink value="Edit" action="#{amb.appEdit(a)}"/><br/>
                        <h:commandLink value="Delete" action="#{amb.deleteAplicant()}" onclick="return confirm('Are you sure delete not?')"/><br/>
                    </p:column>
                </p:dataTable>
                <p:commandButton action="Create" value="New Create"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
